package com.example.springmvcproject.Vo;

import lombok.Data;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;
import java.io.Serializable;

@Data
public class UpdatePasswordVo implements Serializable {
    @NotNull(message = "密码不能为空")
    @Length(min = 8,max = 16,message = "密码需要在8~16个字符之间")
    @Pattern(regexp = "^[A-Z][\\dA-Za-z]+$" ,message = "密码需要首字母大写，且为字母数字的组合")
    private String oldPassword;
    @NotNull(message = "密码不能为空")
    @Length(min = 8,max = 16,message = "密码需要在8~16个字符之间")
    @Pattern(regexp = "^[A-Z][\\dA-Za-z]+$" ,message = "密码需要首字母大写，且为字母数字的组合")
    private String newPassword;
}
